package com.xiaomaoguai.observer.pull;

/**
 * @ FileName: ConcreteObserver.java
 * @ Author: WeiHui-Z
 * @ Date: 2017/4/25 14:16
 * @ Version: v1.0.0
 */
public class ConcreteObserver implements Observer {

    //观察者的状态
    private String observerState;

    @Override
    public void update(Subject subject) {
        /*
         * 更新观察者的状态，使其与目标的状态保持一致
         */
        observerState = ((ConcreteSubject) subject).getState();
        System.out.println("观察者状态为：" + observerState);
    }

}
